package com.frame.server.user.mvc.web;

import com.alibaba.csp.sentinel.annotation.SentinelResource;

import com.frame.common.tools.pojo.OrderVO;
import com.frame.common.tools.result.ServiceResult;
import com.frame.server.user.feign.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @auther zhangwj
 * @date 2021/3/10 下午3:52
 */
@RestController
@RequestMapping(value = "user")
@SentinelResource(value = "user")
public class UserController {

    @Resource
    private OrderService orderService;

    @GetMapping(value = "get")
    public ServiceResult<OrderVO> getSuccess() {
        return orderService.getOrder();
    }

    @GetMapping(value = "test")
    public ServiceResult<String> test() {
        return ServiceResult.getSuccessResult("11222333");
    }
}
